//
//  ARP_AlertAppDelegate.h
//  ARP Alert
//
//  Created by James Richardson on 7/28/11.
//  Copyright 2011 Home. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "ARPdata.h"
#import "NETdata.h"
#import "GETnetworkInfo.h"
//#import "AuthController.h"

@interface ARP_AlertAppDelegate : NSObject <NSApplicationDelegate> {
    NSWindow *window;
    
    //main arrays --> they store NSMutableDictionsries of data, filled from in GETnetworkInfo class
    NSMutableArray *ARParr;
    NSMutableArray *NETarr;
    
    //stores trusted mac addrs
    NSMutableArray *TRUSTarr;
    
    //hook up the table views
    IBOutlet NSTableView *ARPTableView;
	IBOutlet NSTableView *NETTableView;
    IBOutlet NSTableView *TRUSTTableView;
    
    IBOutlet NSTableColumn *TRUST_macCol;
    
    IBOutlet NSTableColumn *ARP_ipCol;
	IBOutlet NSTableColumn *ARP_macCol;
	IBOutlet NSTableColumn *ARP_hostCol;
	IBOutlet NSTableColumn *ARP_trustCol;
	
	IBOutlet NSTableColumn *NET_ipCol;
	IBOutlet NSTableColumn *NET_macCol;
	IBOutlet NSTableColumn *NET_interfaceCol;
    
    //need to know if the arp table is static or not
    BOOL ARPisStatic;
    
    IBOutlet NSMatrix *radioButtons;
    IBOutlet NSButtonCell *dynamicButton;
    IBOutlet NSButtonCell *staticButton;
    
    IBOutlet NSButton *removeTrustButton;
    IBOutlet NSButton *autoCheckForUpdate;
    
    
    NSTimer* timer;
    
}

//-(IBAction)populateDict:(id)sender;
-(IBAction)removeTrust:(id)sender;
-(IBAction)refreshAll:(id)sender;


- (BOOL)checkForTrust_location:(NSInteger)arrayLocation;
- (BOOL)checkForTrust_deep:(NSString*)mac;

- (void)save;
- (void)load;
- (void)staticChecker;

- (void)refreshTables;
- (void)refreshButtons;
- (void)refreshData;
- (void)mainLoopTimerRefresh:(NSTimer*)ntp;
- (void)checkAlertUser;

//- (BOOL)isDataSourceAvailable;
- (IBAction)checkForUpdateMan:(id)sender;
- (void)checkForUpdateAuto;

- (IBAction)radioGroupDynamic:(id)sender;
- (IBAction)radioGroupStatic:(id)sender;
- (BOOL)writeToFile;
int auth(char *tool, char *args[]);


@property (assign) IBOutlet NSWindow *window;

@end

